const path = require('path')
const Timestamp = new Date().getTime()
module.exports = {
    lintOnSave: false,
    productionSourceMap: false,
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [
                path.resolve(__dirname, './src/assets/less/public.less')
            ]
        },
    },
    configureWebpack: {
        output: {
            filename: `js/[name].${Timestamp}.js`, // 每次构建打包时给文件名加上时间戳，确保每次版本更新的文件名不一样
            chunkFilename: `js/[name].${Timestamp}.js`
        },
    },
    // chainWebpack: config => {
    //     // 查看打包文件体积大小
    //     config
    //         .plugin('webpack-bundle-analyzer')ls

    //         .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
    // },
    devServer: {
        proxy: {
            '/api': {
                // target: 'http://192.168.3.159:81/admin-domain/',
                target: 'http://test.sup84.com/admin-domain/',
                changeOrigin: true,
                    pathRewrite: {
                        '^/api': ''
                    }
            }
        }
    }
}
